package com.daifeng.gulimall.search.controller.web;

import com.daifeng.gulimall.search.services.MallSerchService;
import com.daifeng.gulimall.search.vo.SearchPamarVo;
import com.daifeng.gulimall.search.vo.SerachResults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.naming.directory.SearchResult;

@Controller
public class router {


    @Autowired
    MallSerchService serchService;

    @RequestMapping({"/","/list.html","list"})
    public String toList(SearchPamarVo pamarVo , Model model){

        SerachResults result  =  serchService.search(pamarVo);
        model.addAttribute("result",result);
        return "list";
    }

}
